TEE (Intel SGX)
Related: SGX tutorial memo
Intel SGX Explained
Introducing the Intel® Software Guard Extensions Tutorial Series
Intel SGX入門 - SGX基礎知識編
Intel SGX入門 - SGXプログラミング編
Adventures of an Enclave (SGX / TEEs)
http://msyksphinz.hatenablog.com/entry/2018/08/21/040000
vschiavoni/sgx-papers: A list of system papers using/about Intel SGX
https://seminar-materials.iijlab.net/iijlab-seminar/iijlab-seminar-20181120.pdf
https://software.intel.com/en-us/articles/intel-sgx-web-based-training
https://pdfs.semanticscholar.org/9e44/9c2fa2941122fd3b93fc9c7ef28ec588829f.pdf
Trustee: Full Privacy Preserving Vickrey Auction on top of Ethereum
XPDDS18: Design Session - SGX deep dive and SGX Virtualization Discussion, Kai Huang, Intel
A Comparison Study of Intel SGX and AMD Memory Encryption Technology
CoSMIX: A Compiler-based System for Secure Memory Instrumentation and Execution in Enclaves
Intel SGXによるプライバシー保護 生命情報解析プラットフォーム
AccTEE: A WebAssembly-based Two-way Sandbox for Trusted Resource Accounting
Trusted Execution Environment Provisioning (teep)
Dynamic vs Static root of trust
Secure and Private Function Evaluation with Intel SGX
Hardware-assisted Trusted Execution Environments Look Back, Look Ahead
STRESS-SGX
https://github.com/sebva/stress-sgx
https://github.com/gskapka/rust-sgx-db-shim
https://www.linux-kvm.org/images/e/e8/KVM_Forum_2018_-_Intel_SGX.pdf
https://www.youtube.com/watch?v=nJk8b25AJd8
クラウドにおけるIntel SGXを用いた VMの安全な監視機構
SGXIO: Generic Trusted I/O Path for Intel SGX
Formal Abstractions for Attested Execution Secure Processors
video
ROTE: Rollback Protection for Trusted Execution
video
Iron: Functional Encryption using Intel SGX
A Formal Foundation for Secure Remote Execution of Enclaves
A Hybrid Approach to Secure Function Evaluation using SGX
libos
SCONE: Secure Linux Containers with Intel SGX
PANOPLY: Low-TCB Linux Applications with SGX Enclaves
opensource tee
https://github.com/keystone-enclave
https://github.com/google/asylo
https://github.com/openenclave/openenclave
https://github.com/OP-TEE/optee_os
sdk
https://github.com/baidu/rust-sgx-sdk
https://dingelish.github.io
https://qconsf.com/sf2017/system/files/presentation-slides/qconsf-reviewed-ding.pdf
https://github.com/fortanix/rust-sgx
projects
oasis
https://www.youtube.com/watch?v=xF50qCIYwpQ
https://fortanix.com
これベースらしい
enigma
https://www.youtube.com/watch?v=VCW1STJfRVs
sealing
intel生成のユニークなdec keyをenclave内にuntrusted partには暗号化して保持
remote attestation
https://gyazo.com/c3ce355257cdb8b51da45a907cd6e793
安全なenclaveであることのattestationをintelに。
enclaveごとに1回、reportをethereumに記録
https://github.com/enigmampc/enigma-core
chainlink
https://www.youtube.com/watch?v=Zu6uZ1PnRU4
Graphene
Practical implications of Intel SGX with Graphene
https://www.cs.unc.edu/~porter/pubs/graphene-sgx.pdf
Golem’s essential guide to Graphene
https://github.com/oscarlab/graphene
hyperledger private data objects
https://github.com/hyperledger-labs/private-data-objects
Private Data Objects: an Overview
Private Data Objects Smart Contracts on Private Data
https://www.youtube.com/watch?v=I1HbFPwo4gg
substrate tee
https://github.com/scs/substraTEE-node
https://github.com/scs/substraTEE
corda
https://docs.corda.net/head/design/sgx-integration/design.html
https://medium.com/corda/corda-and-sgx-a-privacy-update-c1a74354c156
https://medium.com/corda/developer-preview-java-in-intel-sgx-8d7127ede826
Copy protection
CyberLink PowerDVD
カスタマーサポート - Ultra HD ブルーレイ ムービーの再生プラットフォームを構成する際に設定すべきことは | CyberLink
vulnerabilities
SGX-ROP: Practical Enclave Malware with Intel SGX
Dispelling Myths Around SGX Malware
Foreshadow
Foreshadow: Breaking the Virtual Memory Abstraction with Transient Out-of-Order Execution
Foreshadow (security vulnerability) - Wikipedia
The Magic of Intel’s SGX
EnclaveはEPC(Enclave Page Cache)に保存。
https://gyazo.com/3318d7cca9f7f47a3628b74bb99fc3fb
EPCM(Enclave Page Cache Map)
EPCのsecurity attributes を管理
DRAMはPRM(Processor Reserved Memory)を含み、PRMはEPCを含む
https://gyazo.com/ba6850676a2f53ae72c0e40d365f843b
MEE(Memory Encryption Engine)
唯一、CPU内のデータを復号化可能
https://gyazo.com/3c3e8cedf3406e52bee010ccfe893ea9
Trusted component(protected memory)にアクセス
provessorがenclave modeで動作
https://gyazo.com/d566d479d2a0ab622071d188e1c6d3a0
Overview of Intel SGX - Part 1, SGX Internals
AE (Architectual Enclave)
ユーザーが直接処理の命令やデータのやり取りを行えない特殊なEnclave群
PvE
QE
LE
など
PvE (Provisioning Enclave)
e-fuge
CPU固有のID(Provisioning Secret)が保存され、IPS(Intel Provisioning Service)のデータベースにも同様に保持。
PvEはEGETKEY命令によりe-fuge内のProvisioning secretをreadし、IPSと通信しEPID keyを取得するEnclave。
EPID:マスター公開鍵に対し複数のメンバ秘密鍵を対応
EPID KEYを取得するのがPvEのミッションなので初回利用時で役目を終える
Sealing: EPIDメンバ秘密鍵を再びe-fugeにストアする
https://gyazo.com/6aea756d040dd29fdda93d9a803276df
https://software.intel.com/en-us/articles/intel-enhanced-privacy-id-epid-security-technology
ここで取得したEPID memebr private keyはattestationで用いられる。
QE (Quoting Enclave)
PvEがSealingしたEPID member private keyに対して唯一アクセス可能なEnclave
remote attestation時にEGETKEY命令によりmember private keyを取得し、REPORT構造体(Enclave検証用の公開情報)にEPID member private keyで署名しQUOTE構造体を生成。
Sealing
Enclave内で扱う機密性の高いデータを不揮発性メモリに保存するための操作。
PvEによってe-fuseにストアされた鍵を用いてEnclave内のデータを128bit AES/GCMで暗号化し、Enclave外で不揮発性メモリ上に保存。
Sealing用の鍵はMRENCLAVEポリシーかMRSIGNERポリシーにしたがってSGXが生成。
MRENCLAVE
Config file、Enclave image, Enclave署名ツールのversionに依存するハッシュ値
同じconfig fileで同じ環境で同じソースコードでビルドすれば同一のMRENCLAVEが得られる。
MRSIGNER
署名情報に依存するハッシュ値
configファイルやソースコードが異なっていても、署名鍵が一致しているとunsealing可能。
シーリング鍵はCPU固有のIDに依存して生成されるのでどちらのポリシーでもSealing dataを別のマシンにコピーしてunsealingすることはできない。
proxy
The Intel SGX SDK’s solution to this problem is to copy the contents of data buffers into and out of enclaves, and have the ECALLs and OCALLs operate on these copies of the original memory buffer.